# 单机启动脚本(开发环境)
# 启动顺序： 注册中心、网关、其他组件(并行)
#！/bin/bash

## 源代码构建
echo "[`date +%Y-%m-%d\ %H:%M:%S`] ===> Begin to Build Publish System Module"
mvn clean package -Dmaven.test.skip=true
echo "[`date +%Y-%m-%d\ %H:%M:%S`] ===> Finish to Build Publish System Module"

## jar包路径扫描并启动
echo "[`date +%Y-%m-%d\ %H:%M:%S`] ===> Begin to Scan AND Start Publish System Module"
register_jar_path=`find -name publish_eureka_server*.jar -type f`
common_jar_path=`find -name publish_common*.jar -type f`
java -jar $register_jar_path &

all_jar_path=`find -name *.jar -type f`
for path in $all_jar_path;do
  if [ $path == $register_jar_path -O $path == common_jar_path ]; then
    continue
  fi
  java -jar $path &
done
echo "[`date +%Y-%m-%d\ %H:%M:%S`] ===> Finish Scan AND Start Publish System Module"